<?php
if (isset($rows) && count($rows) > 0) {
    ?>
    <h1>Messages</h1>
    <table width="400" border="1" class="table table-striped">
        <thead>
            <tr>
                <th>Nama</th>
                <th>Message</th>

            </tr>
        </thead>
        <?php
        foreach ($rows as $row) { 
            echo "<tr>";
            echo "<td>$row->id_friend</td>";
            echo "<td>$row->message</td>";
            echo "</tr>";
        }
        ?>
    </table>
    <?php
}
?>